package com.lian.helloworld.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;


@Controller
public class HelloWorldController {
	
	String message = "Welcome to SpringMVC ...";
	
	@RequestMapping("/hello")
	public ModelAndView sendMessage(@RequestParam(value="name",required=false,defaultValue="HEHE")String name){
		
		ModelAndView mv = new ModelAndView("helloworld");
		mv.addObject("message", message);
		mv.addObject("name", name);
		
		return mv;
	}
	
	
	
	
}
